<?php
if (!empty($_POST['cp_save'])) {
	$this->options["crop"] = $_POST['cp_crop'];
	$this->options["quality"] = $_POST['cp_quality'];
	$this->options["FTwidth"] = $_POST['cp_FTwidth'];
	$this->options["FTheight"] = $_POST['cp_FTheight'];
	$this->options["MTwidth"] = $_POST['cp_MTwidth'];
	$this->options["MTheight"] = $_POST['cp_MTheight'];
	$this->options["GTwidth"] = $_POST['cp_GTwidth'];
	$this->options["GTheight"] = $_POST['cp_GTheight'];
	update_option($cpanel['name'], $this->options);
	echo '<div class="updated fade msg" id="message"><p>Your changes have been saved.</p></div>';
}
?>

<div class="cpage">
<h2>Thumbnail Options</h2>

<form action="" method="post">

<fieldset><legend>General Options</legend>
<ul>
	<li><label for="cp_crop">Cropping Technique (requires ImageMagick)</label></li>
	<li>
	<select name="cp_crop" class="widefat big">
	<option value="1"<?php selected(1, $this->options["crop"]); ?>>Crop towards the top</option>
	<option value="2"<?php selected(2, $this->options["crop"]); ?>>Crop towards the center</option>
	<option value="3"<?php selected(3, $this->options["crop"]); ?>>Crop towards the bottom</option>
	<option value="4"<?php selected(4, $this->options["crop"]); ?>>Disable cropping - resize only!</option>
	</select>
	</li>
</ul>
<ul>
	<li><label for="cp_quality">Thumbnail Image Quality</label></li>
	<li>
	<select name="cp_quality" class="widefat chc">
	<?php for ($q = 5; $q <= 95; $q += 10) { ?>
	<option value="<?php echo $q; ?>"<?php selected($q, $this->options["quality"]); ?>><?php echo $q; ?></option>
	<?php } ?>
	</select>
	</li>
</ul>
</fieldset>

<fieldset><legend>Configure Thumbnail Sizes</legend>
<ul>
	<li><label for="cp_FTwidth">Featured thumbnail width</label></li>
	<li><input class="widefat num" name="cp_FTwidth" id="cp_FTwidth" value="<?php echo $this->options["FTwidth"]; ?>" />&nbsp;&nbsp;pixels</li>
</ul>
<ul>
	<li><label for="cp_FTheight">Featured thumbnail height</label></li>
	<li><input class="widefat num" name="cp_FTheight" id="cp_FTheight" value="<?php echo $this->options["FTheight"]; ?>" />&nbsp;&nbsp;pixels</li>
</ul>
<ul>
	<li><label for="cp_MTwidth">Main page thumbnail width</label></li>
	<li><input class="widefat num" name="cp_MTwidth" id="cp_MTwidth" value="<?php echo $this->options["MTwidth"]; ?>" />&nbsp;&nbsp;pixels</li>
</ul>
<ul>
	<li><label for="cp_MTheight">Main page thumbnail height</label></li>
	<li><input class="widefat num" name="cp_MTheight" id="cp_MTheight" value="<?php echo $this->options["MTheight"]; ?>" />&nbsp;&nbsp;pixels</li>
</ul>
<ul>
	<li><label for="cp_GTwidth">Archive thumbnail width</label></li>
	<li><input class="widefat num" name="cp_GTwidth" id="cp_GTwidth" value="<?php echo $this->options["GTwidth"]; ?>" />&nbsp;&nbsp;pixels</li>
</ul>
<ul>
	<li><label for="cp_GTheight">Archive thumbnail height</label></li>
	<li><input class="widefat num" name="cp_GTheight" id="cp_GTheight" value="<?php echo $this->options["GTheight"]; ?>" />&nbsp;&nbsp;pixels</li>
</ul>
</fieldset>

<input type="submit" value="Update Settings" name="cp_save" class="button-primary" />
</form>

</div>